import pymysql

def m_co():
    myclient = pymysql.connect(
        host = '192.168.88.102',
        user = 'root',
        password = 'Aa123456@',
        port = 3306
    )
    cursor = myclient.cursor()
    data = []
    for data in range(10000):
        data.append(data)
        #id是int类型，无法用append插入
    sql = """
        insert into stu(id) values(%s)
    """
    cursor.executemany(sql,data)
    myclient.commit()
    cursor.close()
    myclient.close()

if __name__ == '__main__':
    m_co()
